HAL RAMECC migration: List of applicable concepts

This section provides information about the HAL RAMECC applicable architecture concepts.

Concepts for RAMECC

Concept

Description

HAL implementation with LL inline functions

HAL RAMECC APIs rely now on LL APIs rather than performing direct register access.

Define statements and enumerations redirected to LL equivalents

HAL RAMECC define statements and enumerations are based on LL define statements.

Removal of hardware-related macros in HAL2

All hardware macros have been removed from the HAL RAMECC driver, and equivalent services are ensured through the LL APIs.

Revised and optimized HAL API status returns

HAL RAMECC APIs return status using the type hal_status_t.

Revised and optimized HAL error management

There is no need for error management in the RAMECC driver, as no error conditions are generated by this peripheral.

Replaced TypeDef suffix with _t in type names

All TypeDef parts of the HAL RAMECC driver have been removed and replaced by _t

Replaced multi-line macros with inline functions

For the HAL RAMECC driver, large macros have been replaced by inline functions to maintain code consistency, improve readability, and benefit from compiler optimization. Inline functions also offer better support for debugging and strict type management, reducing the risk of errors.

Replaced nonmodifiable pointers with const keywords

Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable.

Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.

Finite parameters (including RAMECC instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety.

Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).

All HAL RAMECC functions start with HAL_RAMECC. All HAL RAMECC enumerations and structures start with hal_ramecc.

Other HAL RAMECC changes

Concept

Consideration

Remove the handle and use instance as parameter of the various HAL functions including the HAL_RAMECC_IRQHandler

The handle and initialization structures have been removed, and the instance passed directly to the various RAMECC functions is now used instead.

Split global and monitor APIs to let the user either handle the RAMECC by monitor (that is, by RAM) or all at once through global APIs.

In HAL1, the HAL_RAMECC_EnableNotification function could be called with either GLOBAL or MONITOR interrupts. In HAL2, the equivalents are HAL_RAMECC_EnableController_IT and HAL_RAMECC_EnableMonitor_IT, respectively. The main difference in HAL2 is that these functions also replace the call(s) to HAL_RAMECC_StartMonitor from HAL1. In general, the terminology global in HAL1 is replaced by controller in HAL2.